package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.ClientUserClientFallBack;
import cn.cs.fallback.UserCompanyClientFallBack;
import cn.cs.pojo.ClientRepRel;
import cn.cs.pojo.ClientUser;
import cn.cs.pojo.UserCompany;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = UserCompanyClientFallBack.class)
public interface RestUserCompanyClient {


    @RequestMapping(value = "/getUserCompanyById", method = RequestMethod.POST)
    public UserCompany getUserCompanyById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getUserCompanyListByMap", method = RequestMethod.POST)
    public List<UserCompany> getUserCompanyListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getUserCompanyCountByMap", method = RequestMethod.POST)
    public Integer getUserCompanyCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addUserCompany", method = RequestMethod.POST)
    public Integer addUserCompany(@RequestBody UserCompany userCompany) throws Exception;

    @RequestMapping(value = "/modifyUserCompany", method = RequestMethod.POST)
    public Integer modifyUserCompany(@RequestBody UserCompany userCompany) throws Exception;

    @RequestMapping(value = "/deleteUserCompanyById", method = RequestMethod.POST)
    public Integer deleteUserCompanyById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/updateCompanyTypeId", method = RequestMethod.POST)
    public Integer updateCompanyTypeId(@RequestParam("id") String id) throws Exception;

}

